<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>

</body>
<script>
	// const a = localStorage.getItem("userName")? localStorage.getItem("userName"):{};
	
	// ?? 左侧为undefined或null,那么结果为？？右侧的值
	// const a = localStorage.getItem("userName") ?? {};
	// console.log(a);
	
	const a = undefined ?? 1;
	console.log(a);// 1
	
	const b = null ?? 2
	console.log(b);// 2
	
	const c = true ?? 3;
	console.log(c);
	
	const d = false ?? 3;
	console.log(d);
</script>

</html>